﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.UI;
using System.Windows.Forms;

namespace GeoAPI
{
    public class FastMaterialDlgApp2 : IExternalApplication
    {
        public Result OnShutdown(UIControlledApplication application)
        {

            //if (FastMaterialDlgApp.m_MyForm != null && FastMaterialDlgApp.m_MyForm.Visible)
            //{
            //    FastMaterialDlgApp.m_MyForm.Close();
            //}
            return Autodesk.Revit.UI.Result.Succeeded;
        }

        public Result OnStartup(UIControlledApplication application)
        {
            MessageBox.Show("Auto Load");
            // 神奇的是，有些引用无法加载，必须在命令执行开始时，调用一下，后面才可以不出问题
            try
            {
                //GridToolExportImportExcel gridToolExportImportExcel = new GridToolExportImportExcel(false);
                FlexCell.Grid grid = new FlexCell.Grid();
            }
            catch (Exception ex)
            {
                string ss = ex.Message;

            }

            //FastMaterialDlgApp.m_MyForm = null;
            //FastMaterialDlgApp.thisApp = this;
            return Autodesk.Revit.UI.Result.Succeeded;
        }

    }
}

